import { Channel } from '@/types/data'
import { HomeAction } from '@/types/store'

type HomeState = {
  userChannels: Channel[]
}

const init: HomeState = {
  userChannels: [],
}

const home = (state = init, action: HomeAction): HomeState => {
  if (action.type === 'home/saveUserChannel') {
    return {
      ...state,
      userChannels: action.payload,
    }
  }
  return state
}
export default home
